Str=input("请输入一串字符串：")
for i in '!"#$%&()*+,-./:;<=>?@[\]^_`{|}~':
    Str=Str.replace(i," ");
counts={};
for word in Str:
    if word==" ":
        continue;
    counts[word]=counts.get(word,0)+1;
items=list(counts.items());
items.sort(key=lambda x:x[1],reverse=True);
print("{",end="")
for i in range(len(items)):
    print("'{}':{}".format(items[i][0],items[i][1]),end=",")
print("}",end="")